<template>
  <div class="hello">
    <vue-flowy :chart="chart"></vue-flowy>
  </div>
</template>

<script>
import { VueFlowy, FlowChart } from "vue-flowy";
export default {
  name: 'FlowVue',
  components: {
    VueFlowy
  },
  data () {
    return {
      chart: new FlowChart({ direction: "TB" })
    }
  },
  created(){

  },
  mounted() {
    // first flowChart
    const idea = this.chart.addElement("idea");
    const A = this.chart.addElement("A", { label: "vscode" });
    const B = this.chart.addElement("B", { label: "github" });
    const C = this.chart.addElement("C", { label: "npm" });
    idea.leadsTo(A).leadsTo(B);
    A.leadsTo(C);

    A.on("click", function() {
      console.log("click!");
    });
  },
  methods:{

  },
  computed:{
    
  },
  watch:{
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>
